This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace System.Web.Mvc | |
{ | |
public static class HelperExtensions | |
{ | |
public static MvcHtmlString If(this MvcHtmlString value, bool evaluation) | |
{ | |
return evaluation ? value : MvcHtmlString.Empty; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
float value = new House( 2, "Home", 3, 2, 1900 ).appraise(); | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public House( int _i, String _s, String _h, int _i2, int _i3 ){ | |
houseBedrooms = _i; | |
houseName = _s; | |
houseBathrooms = _i2; | |
houseSquareFeet = _i3; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public House(int _i, String _s, String _h, int _i2, int _i3, int _windows){ | |
houseBedrooms = _i; | |
houseName = _s; | |
houseBathrooms = _i2; | |
houseSquareFeet = _i3; | |
houseWindows = _windows; // added! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class House { | |
private int houseBedrooms; | |
private int houseBathrooms; | |
private int houseSquareFeet; | |
private String houseName; | |
public House( int _i, String _s, String _h, int _i2, int _i3 ){ | |
houseBedrooms = _i; | |
houseName = _s; | |
houseBathrooms = _i2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class House { | |
private int houseBedrooms; | |
private int houseBathrooms; | |
private int houseSquareFeet; | |
private int houseWindows; // added! | |
private String houseName; | |
public House( int _i, String _s, int _i2, int _i3, int _windows ){ | |
houseBedrooms = _i; | |
houseName = _s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
House house = new House( 2, "Home", 3, 1900, 4 ); | |
float value = house.appraise(); | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setters | |
public void setBedrooms( int _set ){ | |
houseBedrooms = _set; | |
} | |
public void setName( String _set ){ | |
houseName = _set; | |
} | |
public void setBathrooms( int _set ){ | |
houseBathrooms = _set; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
House house = new House(); | |
house.setBedrooms( 2 ); | |
house.setName( "Home" ); | |
house.setBathrooms( 3 ); | |
house.setSquareFeet( 1900 ); | |
house.setWindows( 4 ); | |
float value = house.appraise(); | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
float value = new House() | |
.setBedrooms( 2 ) | |
.setName( "Home" ) | |
.setBathrooms( 3 ) | |
.setSquareFeet( 1900 ) | |
.setWindows( 4 ) | |
.appraise(); | |
// ... |
OlderNewer